<?php use_javascript('ckeditor.js') ?>
<?php use_javascript('jquery_adapter.js') ?>

<div class="mainpage">

    <p class="logobgsmall"></p>
    <?php include_partial('globals/backoffice_menu') ?>
    <?php include_component('globals', 'restaurantDropdown', array('html_id' => 'restaurant_select')) ?>

    <br />

    <!-- left block -->
    <div style="float: left; clear: left; margin-top: 15px;">

        <!-- left widget -->
        <div style="width: 395px;" class="yvo-widget-2col">
            <div class="ui-widget-header ui-corner-all">
                <div class="ui-state-default yvo-widget-header">




                    <?php echo __('Time schedule') ?>
                </div>
            </div>
            <div id="day_interval_tabs" style="width: 390px; height: 255px; ">
                <ul>
                    <li><a href="#tabs-1"><?php echo __('Mon') ?></a></li>
                    <li><a href="#tabs-2"><?php echo __('Tue') ?></a></li>
                    <li><a href="#tabs-3"><?php echo __('Wed') ?></a></li>
                    <li><a href="#tabs-4"><?php echo __('Thu') ?></a></li>
                    <li><a href="#tabs-5"><?php echo __('Fri') ?></a></li>
                    <li><a href="#tabs-6"><?php echo __('Sat') ?></a></li>
                    <li><a href="#tabs-7"><?php echo __('Sun') ?></a></li>
                </ul>
                <?php for ($i = 1; $i <= 7; $i++): ?>
                
                    <div id="tabs-<?php echo $i ?>">
                        <?php include_partial('day_interval_tab', array('intervals' => $day_intervals[$i],
                            'day' => $i-1)) ?>
                    </div>
                <?php endfor ?>
                <?php //FIXME: FIXED-> HV Date started at ?>

            </div>
        </div>

        <!-- right widget -->

        <div style="width: 395px;" class="yvo-widget-2col">
            <div class="ui-widget-header ui-corner-all">
                <div class="ui-state-default yvo-widget-header">
                    <?php echo __('Special dates list') ?>
                </div>
            </div>
            <div class="ui-widget-content ui-corner-all">

                <div class="spacer" style="height: 20px;"></div>			
                <table id="special_reservation_table" class="yvo-hw100">
                    <thead>
                        <tr class="">

                            <th class="ui-widget-header ui-corner-left" scope="col"><?php echo __('Date') ?></th>
                            <th class="ui-widget-header" scope="col"><?php echo __('Description') ?></th>
                            <th class="ui-widget-header ui-corner-right" scope="col">&nbsp;</th>

                        </tr>
                    </thead>
                    <tbody style="height: 250px; overflow-x:hidden; overflow-y: scroll;">
                        <?php foreach ($special_dates as $date): ?>
                            <tr>
                                <td class="ui-highlight txtleft"><?php echo render_date($date['date']) ?></td>
                                <td class="ui-highlight txtleft yvo-indent5"><?php echo $date['description'] ?></td>
                                <td class="ui-highlight txtleft yvo-indent5">
                                	<a id="special_date_delete_<?php echo $date['settings_special_date_id'] ?>"
                                           href="<?php echo url_for('@settings_special_date_delete?id=' . $date['settings_special_date_id']) ?>">
                                    	<span class="ui-state-default ui-corner-all" title="<?php echo __('delete'); ?>">
											<span class="ui-icon ui-icon-minusthick"></span>
										</span>
                                    </a>
                                </td>
                            </tr>
                        <?php endforeach ?>
                    </tbody>
                </table>
                <div class="ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-bottom">
                    <div class="yvo-indent50">
                        <?php echo __('Show') ?> <input id="special_date_no" type="text" size="5" value="<?php echo $settings['special_dates_no'] ?>" /> <?php echo __('dates in the reservation screen') ?>
                        <br/>
                        <div class="yvo-buttons">
                            <input class="ui-button ui-widget ui-state-active ui-corner-all ui-button-text-only ui-button-text" id="add_special_date" type="button" value="<?php echo __('Add new special date') ?>" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- next left block -->
    <div style="float: left; clear: left; margin-top: 15px;">
        <?php include_partial('block_time', array('block_times' => $block_times)) ?>
        <?php include_partial('guest_settings', array('settings' => $settings)) ?>
    </div>
 
    <!-- next left block -->
    <div style="float: left; clear: left; margin-top: 15px;">

        <div style="width: 810px;" class="yvo-widget-2col">
            <div class="ui-widget-header ui-corner-all">
                <div class="ui-state-default yvo-widget-header">
                    <?php echo __('Group reservations') ?>
                </div>
            </div>
            <div class="ui-widget-content ui-corner-all">
                <span class="yvo-indent5"><?php echo __('Group reservation if number of persons greater than: ') ?>
                    <input type="text" id="group_reservation_size" size="5" value="<?php echo $settings['group_size'] ?>" />
                </span>
                <hr />


 
                <table id="reservation_table"  class="yvo-hw100">
                    <thead>
                        <tr>
                            <th class="ui-widget-header ui-corner-left " scope="col"><?php echo __('Title') ?></th>
                            <th class="ui-widget-header " scope="col"><?php echo __('Description') ?></th>
                            <th class="ui-widget-header ui-corner-right">&nbsp;</th>
                            <th class="ui-widget-header ui-corner-right">&nbsp;</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php foreach ($menu_list as $menu): ?>
                            <tr  class="ui-helper-reset ui-widget-content ui-corner-all yvo-hw100">
                                <td><div class="ui-helper-reset yvo-hw100"><?php echo html_entity_decode($menu['name']); ?></div></td>
                                <td><div class="ui-helper-reset ui-widget-content ui-corner-all yvo-hw100"><?php echo html_entity_decode($menu['description']) ?></div></td>
                                <td>
                                    <div class="ui-helper-reset yvo-hw100">
                                        <a id="group_menu_delete_<?php echo $menu['menu_id'] ?>"
                                            href="<?php echo url_for('@settings_group_menu_delete?id=' . $menu['menu_id']) ?>"
                                            title="<?php echo __('delete'); ?>">
                                                <span class="ui-state-default ui-corner-all" title="<?php echo __('delete'); ?>">
                                                        <span class="ui-icon ui-icon-minusthick"></span>
                                                </span>
                                        </a>
                                    </div>
                                </td>
                                <td>
                                    <div class="ui-helper-reset yvo-hw100">
                                        <a id="group_menu_edit_<?php echo $menu['menu_id'] ?>"
                                            href="<?php echo url_for('@settings_group_menu_edit?id=' . $menu['menu_id']) ?>"
                                            title="<?php echo __('edit'); ?>">
                                            <span class="ui-state-default ui-corner-all" title="<?php echo __('edit'); ?>">
                                                <?php echo __('edit') ?>
                                            </span>
                                        </a>
                                    </div>
                                </td>
                            </tr>
                        <?php endforeach ?>
                        
                    </tbody>
                </table>
                <div class="yvo-buttons">
                    <input class="ui-button ui-widget ui-state-active ui-corner-all ui-button-text-only ui-button-text" id="add_group_menu" type="button" value="<?php echo __('Add group menu') ?>" />
                </div>
            </div>
        </div>
    </div>

    <!-- next left block -->
    <div style="float: left; clear: left; margin-top: 15px;">

        <?php include_partial('email_header_footer_form', array('form' => $emailHeaderFooterForm)) ?>

    </div>
    
    <!-- next left block -->
    <div style="float: left; clear: left; margin-top: 15px;">

        <?php include_partial('template_header_footer_form', array('form' => $htmlHeaderFooterForm)) ?>

    </div>

    <!-- next left block -->
    <div style="float: left; clear: left; margin-top: 15px;">

        <div style="width: 810px;" class="yvo-widget-2col">
            <div class="ui-widget-header ui-corner-all">
                <div class="ui-state-default yvo-widget-header">
                    <?php echo __('Customer contact templates') ?>
                </div>
            </div>

        
	        <div class="ui-widget-content ui-corner-all">
	            <?php include_partial('email_template') ?>
	        </div>
		</div>

    </div>
    </div>